<!--
 * @Author: only
 * @Date: 2025-02-24 16:40:57
 * @LastEditors: sueRimn
 * @LastEditTime: 2025-03-10 10:30:54
-->
<template>
  <div class="audit-process">
    <div class="name">{{ title }}</div>
    <el-timeline>
      <el-timeline-item
        v-for="(item,index ) in flowRecordList"
        :key="index"
        color="#1890ff"
      >
        <p style="font-weight: 700">{{item.taskName}}</p>
        <el-card :body-style="{ padding: '10px' }">
          <el-descriptions class="margin-top" :column="1" size="small" border>
            <el-descriptions-item label-class-name="my-label" v-for="(subItem,subIndex) in item.list" :key="subIndex" >
              <template slot="label">{{ subItem.name }}</template>
              {{subItem.value}}
            </el-descriptions-item>
          </el-descriptions>
        </el-card>
      </el-timeline-item>
    </el-timeline>
  </div>
</template>

<script>
export default {
  props:{
    processData: {
      type: Array,
      default: [],
    },
    title: {
      type: String,
      default:'审核进度',
    },
  },
  data() {
    return {
       flowRecordList:[
        // {taskName:'部门领导审批',list:[{name:'办理人',value:''},{name:'接收时间',value:''}]},
        // {taskName:'请假申请',list:[{name:'办理人',value:''},{name:'接收时间',value:''},{name:'处理时间',value:''},{name:'耗时',value:''},{name:'处理意见',value:''}]}
      ],

    };
  },

  mounted() {
   this.getLoad();
  },
  methods: {
    //获取数据
    getLoad() {
      if(this.processData.length){
        this.processData.forEach((item)=>{
          let obj = {
            taskName:item.type,
            list:[
              {
                name:'审核人',
                value:item.auditUserName
              },
              {
                name:'审核时间',
                value:item.auditTime
              },
              {
                name:'审核状态',
                value:item.status
              },
              {
                name:'审核理由',
                value:item.reason
              }
            ]
          }
          this.flowRecordList.push(obj)
        })
      }

    },

  },
};
</script>

<style lang="scss">
@import "../../../assets/styles/collect.scss";
</style>
